// 配置编译环境和线上环境之间的切换
let apiBase = {

  // 开发环境API地址
  // development:'http://127.0.0.1:9999',
  development:'http://192.168.1.53:9999',

  // 测试环境API地址
  test:'',

  // 线上环境API地址
  production:'http://192.168.1.63:9999'
}

let config = {

  identification: 'sca-vue-front', //前端唯一标识(1~20字符)

  verifyCodeFlag: '2', // 登录验证码方式：1、算术验证码   2、滑块验证码
  gatewayFlag: '1', // 网关类型：1、gateway   2、zuul

  encryptKey: 'scaxscaxscaxscax', //加密key

  apiBase,

  serviceType: "MICRO", //后端服务类型，单体：SINGLE，微服务：MICRO

  proxy: {
    MICRO: {
      '/': {
        target: apiBase[process.env.NODE_ENV],
        ws: false, // 需要websocket 开启
        pathRewrite: {
          '^/': '/'
        }
      }
    },
    SINGLE: {
      '/admin': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/admin': '/'
        }
      },
      '/auth': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/auth': '/'
        }
      },
      '/gen': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/gen': '/'
        }
      },
      '/comm': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/comm': '/'
        }
      },
      '/job': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/job': '/'
        }
      },
      '/svrmonitor': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/svrmonitor': '/'
        }
      },
      '/msg': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/msg': '/'
        }
      },
      '/ws': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/ws': '/'
        }
      },
      '/scabpm': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/scabpm': '/'
        }
      },
      '/': {
        target: apiBase[process.env.NODE_ENV],
        ws: false,
        pathRewrite: {
          '^/': '/'
        }
      }
    }
  }
}

module.exports = config

